<template>
  <el-table class="el-table"
    :data="chanpin"
    style="width: 100%;color:black"
    height="580"
    >
    <el-table-column
      fixed
      prop="name"
      label="商品信息"
      width="300">
    </el-table-column>
    <el-table-column
      prop="guige"
      label="总重"
      >
    </el-table-column>
    <el-table-column
      prop="kougan"
      label="口感"
      >
    </el-table-column>
    <el-table-column
      prop="type1"
      label="类型"
      >
    </el-table-column>
    <el-table-column
      prop="type2"
      label="分类"
     >
    </el-table-column>
  </el-table>
</template>

<script>
import httpApi from "@/myaxios/index"
  export default {
    data() {
      return {
        types:[],
        chanpin:[]
      }
    },
    mounted () {
      let id = this.$route.params.id
    httpApi.GerenZhongxin.querydingdanByid({ id }).then(res => {
				console.log('加载所有订单列表类别', res.data)
				//渲染option列表
				this.types=res.data
        console.log(this.types)
        for(let i=0;i<this.types.length;i++){
          let aid = this.types[i].cid
        httpApi.GerenZhongxin.quanBudingdan({id:aid}).then(res=>{
          console.log('res',res.data)
          this.chanpin.push(res.data[i])
        })
        };
      })
    },
  }
</script>
<style scoped lang="scss">
::v-deep .el-table {
     color: #000;
}
</style>